/**
 * 
 */
package tp.pr5.gui;

import tp.pr5.Controller;
import tp.pr5.RobotEngine;
import tp.pr5.Rotation;
import tp.pr5.instructions.DropInstruction;
import tp.pr5.instructions.MoveInstruction;
import tp.pr5.instructions.OperateInstruction;
import tp.pr5.instructions.PickInstruction;
import tp.pr5.instructions.QuitInstruction;
import tp.pr5.instructions.TurnInstruction;
import tp.pr5.instructions.UndoInstruction;

/**
 * @author Mario
 *
 */
public class GUIController extends Controller {
		
	public GUIController(RobotEngine engine) {
		super(engine);		
	}

	@Override
	public void startController() {	
		
		engine.requestStart();
	}
	/**
	 * Sends a quit instruction
	 */
	public void notifyQuit() {
		engine.communicateRobot(new QuitInstruction());
	}
	/**
	 * Sends a turn instruction
	 * @param rot
	 */
	public void notifyTurn(Rotation rot) {		
			engine.communicateRobot(new TurnInstruction(rot));			
	}
	/**
	 * Sends a pick instruction
	 * @param text
	 */
	public void notifyPick(String text) {
		engine.communicateRobot(new PickInstruction(text));
	}
	/**
	 * Sends a drop instruction
	 * @param selectedItemId
	 */
	public void notifyDrop(String selectedItemId) {
		engine.communicateRobot(new DropInstruction(selectedItemId));
		
	}
	/**
	 * Sends an operate instruction
	 * @param selectedItemId
	 */
	public void notifyOperate(String selectedItemId) {
		engine.communicateRobot(new OperateInstruction(selectedItemId));
		
	}
	/**
	 * Sends a move instruction
	 */
	public void notifyMove() {
		engine.communicateRobot(new MoveInstruction());		
	}
	/**
	 * Sends a undo instruction
	 */
	public void notifyUndo() {
		engine.communicateRobot(new UndoInstruction());		
	}

}
